﻿namespace Admin.NET.Application.Service;


[ApiDescriptionSettings(KeepName = true)]
public class BasEnumTitleService : IDynamicApiController
{
    protected readonly SqlSugarRepository<BasEnumTitle> _rep;

    public BasEnumTitleService(SqlSugarRepository<BasEnumTitle> rep)
    {
        _rep = rep;
    }

    /// <summary>
    /// 获取列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [AllowAnonymous]
    public async Task<SqlSugarPagedList<BasEnumTitle>> Page(BaseKeywordPageInput input)
    {
        return await _rep.Queryable
           .WhereIF(input.Keyword.HasValue(), it => it.enumType.Contains(input.Keyword) || it.title.Contains(input.Keyword))
           .ToPagedListAsync(input.Page, input.PageSize);
    }
}
